//
//  MacrosSettingsModule.h
//  Cantrip
//
//  Created by James Callender on Tue Jun 08 2004.
//  Copyright (c) 2004 James Callender. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <CantripSDK/CantripSDK.h>

#define MacroKeyCodeKey @"keyCode"
#define MacroModifierFlagsKey @"modifierFlags"
#define MacroModifierStringKey @"modifierString"
#define MacroKeyStringKey @"keyString"
#define MacroEnabledKey @"enabled"
#define MacroScriptKey @"script"

@interface MacrosSettingsModule : NSObject <CantripSettingsModuleProtocol>
{
    IBOutlet NSView *oSettingsView;
    NSMutableDictionary *currentlyEditingMacro;
    id currentWorld;
    NSArray *draggedRows;
    
    int tempKeyCode;
    int tempModifierFlags;
    
    IBOutlet NSPanel *oPromptPanel;
    IBOutlet NSTableView *oTableView;
    IBOutlet NSPanel *oEditorPanel;
    IBOutlet NSTextView *oScriptArea;
    IBOutlet NSButton *oEnabledButton;
    IBOutlet NSTextField *oModifierField;
    IBOutlet NSTextField *oKeyField;
}

- (id)world;
- (void)updateForWorld:(id)world;
- (NSDictionary *)defaultWorldProperties;

- (NSString *)modifierStringForEvent:(NSEvent *)event;
- (NSString *)keyStringForEvent:(NSEvent *)event;

- (void)undoChangeValue:(id)value ofKey:(NSString *)key forMacro:(id)macro;
- (IBAction)saveEditorAction:(id)sender;
- (IBAction)cancelEditorAction:(id)sender;
- (IBAction)setKeyButtonAction:(id)sender;
- (IBAction)editMacroAction:(id)sender;
- (IBAction)removeMacroAction:(id)sender;
- (IBAction)removeAction:(id)sender;
- (IBAction)addAction:(id)sender;
- (void)addMacro:(id)macro;
- (void)addMacro:(id)macro atIndex:(int)index;
- (void)removeMacro:(id)macro;


@end
